/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ec.edu.espe.ccsoft.mantenimiento.servicios;

import ec.edu.espe.ccsoft.mantenimiento.dao.TallerFacade;
import ec.edu.espe.ccsoft.mantenimiento.modelos.Taller;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;

/**
 *
 * @author misahaelfernandez
 */
@Stateless
@LocalBean
public class TallerServicio {

    @EJB
    private TallerFacade tallerFacade;

    public List<Taller> obtenerTodos() {
        return this.tallerFacade.findAll();
    }

    public List<Taller> obtenerTodosActivos() {
        return this.tallerFacade.findAllActives();
    }

    public void crear(Taller taller) {
        this.tallerFacade.create(taller);
    }

    public void actualizar(Taller taller) {
        this.tallerFacade.edit(taller);
    }

    public void eliminar(Taller taller) {
        this.tallerFacade.remove(taller);
    }

    public Taller findUnidadMedidaByNombre(String nombre) {
        return tallerFacade.findByNombre(nombre);
    }
}
